<script type="text/javascript" src="script/calendar.php?lang="></script>
<link href="script/calendar/calendar.css" rel="stylesheet" type="text/css" />
<form action="<?php e_page("money","index")?>" method="get">
    <fieldset>
        <legend></legend>
        <label for="event_types">信息类型</label>
        <select name="event_types" id="event_types">
            <option value="">所有</option>
            <?php foreach($r['event_types'] as $k=>$v){?>
                <option value="<?php echo $k?>" <?php if($r['type']==$k) echo 'selected';?>><?php echo $v?></option>
            <?php }?>
        </select>
        <label for="username">用户名</label>
        <input type="text" name="username" id="username" placeholder="请输入用户名">
               
<input name="start_time" type="text" id="start_time" size="22" value='<?php echo $r['start_time']; ?>' readonly="readonly"  style="width:120px"  />
 <input name="selbtn1" type="button" id="selbtn1" onclick="return showCalendar('start_time', '%Y-%m-%d', false, false, 'selbtn1');" value="选择开始时间" class="button"/>
 
 
 <input name="end_time" type="text" id="end_time" size="22" value='<?php echo $r['end_time']; ?>' readonly="readonly"  style="width:120px" />
 <input name="selbtn2" type="button" id="selbtn2" onclick="return showCalendar('end_time', '%Y-%m-%d', false, false, 'selbtn2');" value="选择结束时间" class="button"/>
        <input type="submit" value="搜索" >
    </fieldset>
</form>

<a href="<?php e_action("download","event_types={$r['type']}&username={$r['username']}&start_time={$r['start_time']}&end_time={$r['end_time']}");?>">
    <input type="button" value="导出" style="background: #f00;color: #fff;border: none;padding: 3px 10px;border-radius: 4px;margin-bottom: 5px;" ></a>



<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>用户名（商家名称/服务站名称）</th>
<!--        <th>申请商家</th>-->
<!--        <th>申请服务站</th>-->
        <th>申请提现金额</th>
        <th>提现方式</th>
        <th>账号</th>
        <th>申请时间</th>
        <th>确认时间</th>
        <th>确认</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['money_info'] as $v){?>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?php echo $r[$v['user_id']]['user_id']?>（<?php if(!empty($r[$v['user_id']]['shop_name'])) {echo $r[$v['user_id']]['shop_name'];}?>  <?php if(!empty($r[$v['user_id']]['service_name'])) echo "/".$r[$v['user_id']]['service_name'];?>）</td>
            <td>￥<?php echo $v['money'];?></td>
            <td><?php echo $v['account_type'];?></td>
            <td><?php echo $v['account_no'];?></td>
            <td><?php echo $v['create_time'];?></td>
            <td><?php echo $v['confirm_time'];?></td>
            <td><?php if($v['auth']==0){?><a href="<?php e_action("confirm","id={$v['id']}");?>">确认</a><?php }else{?>已确认 <?php }?></td>
        </tr>
    <?php }?>
    </tbody>
</table>
<?php
/** @var Page $page */
$page=$r['pages'];
?>
<?php echo $page->getPageHtml(); ?>